package com.ryan.spring.annotation.config;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * Created by kaimin on 26/1/2019.
 * time : 23:26
 * 自定义逻辑，返回需要注册到容器的组件数组
 */

public class MyImportSelector implements ImportSelector {
    /**
     *
     * @param importingClassMetadata 当前@Import注解的类的所有注解信息
     * @return 导入到组件中 全类名的数组
     */
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        //不能返回null
        return new String[]{"com.ryan.spring.annotation.model.Red","com.ryan.spring.annotation.model.Blue"};
    }
}
